import config from "@/config"
import http from "@/utils/request"

export default {
	menu: {
		myMenus: {
			url: `${config.API_URL}/rbac/admin/v1/system/menu/my`,
			name: "获取我的菜单",
			get: async function(){
				return await http.get(this.url);
			}
		},
		list: {
			url: `${config.API_URL}/rbac/admin/v1/system/menu`,
			name: "获取菜单",
			get: async function(){
				return await http.get(this.url);
			}
		},
		edit: {
			url: `${config.API_URL}/rbac/admin/v1/system/menu`,
			name: "修改菜单",
			patch: async function(params){
				return await http.patch(this.url,params);
			}
		},
		delete: {
			url: `${config.API_URL}/rbac/admin/v1/system/menu`,
			name: "删除菜单",
			delete: async function(params){
				return await http.delete(this.url,params);
			}
		},
		create: {
			url: `${config.API_URL}/rbac/admin/v1/system/menu`,
			name: "创建菜单",
			post: async function(params){
				return await http.post(this.url,params);
			}
		}
	},
	dic: {
		tree: {
			url: `${config.API_URL}/admin/v1/system/dic/tree`,
			name: "获取字典树",
			get: async function(){
				return await http.get(this.url);
			}
		},
		list: {
			url: `${config.API_URL}/admin/v1/system/dic/list`,
			name: "字典明细",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		get: {
			url: `${config.API_URL}/admin/v1/system/dic/get`,
			name: "获取字典数据",
			get: async function(params){
				return await http.get(this.url, params);
			}
		}
	},
	role: {
		all: {
			url: `${config.API_URL}/rbac/admin/v1/system/role/list`,
			name: "获取所有角色列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		list: {
			url: `${config.API_URL}/rbac/admin/v1/system/role`,
			name: "获取角色列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		edit: {
			url: `${config.API_URL}/rbac/admin/v1/system/role`,
			name: "修改菜单",
			patch: async function(data){
				return await http.patch(this.url,data);
			}
		},
		delete: {
			url: `${config.API_URL}/rbac/admin/v1/system/role`,
			name: "删除菜单",
			delete: async function(data){
				return await http.delete(this.url,data);
			}
		},
		create: {
			url: `${config.API_URL}/rbac/admin/v1/system/role`,
			name: "创建菜单",
			post: async function(data){
				return await http.post(this.url,data);
			}
		}
	},
	dept: {
		list: {
			url: `${config.API_URL}/rbac/admin/v1/system/dept/list`,
			name: "获取部门列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		edit: {
			url: `${config.API_URL}/rbac/admin/v1/system/dept`,
			name: "修改菜单",
			patch: async function(data){
				return await http.patch(this.url,data);
			}
		},
		delete: {
			url: `${config.API_URL}/rbac/admin/v1/system/dept`,
			name: "删除菜单",
			delete: async function(data){
				return await http.delete(this.url,data);
			}
		},
		create: {
			url: `${config.API_URL}/rbac/admin/v1/system/dept`,
			name: "创建菜单",
			post: async function(data){
				return await http.post(this.url,data);
			}
		}
	},
	user: {
		list: {
			url: `${config.API_URL}/rbac/admin/v1/system/user/list`,
			name: "获取用户列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		edit:{
			url: `${config.API_URL}/rbac/admin/v1/system/user`,
			name: "修改用户",
			patch: async function(data){
				return await http.patch(this.url,data);
			}
		}
	},
	app: {
		list: {
			url: `${config.API_URL}/admin/v1/system/app/list`,
			name: "应用列表",
			get: async function(){
				return await http.get(this.url);
			}
		}
	},
	log: {
		list: {
			url: `${config.API_URL}/admin/v1/system/log/list`,
			name: "日志列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		}
	},
	table: {
		list: {
			url: `${config.API_URL}/admin/v1/system/table/list`,
			name: "表格列管理列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		info: {
			url: `${config.API_URL}/admin/v1/system/table/info`,
			name: "表格列管理详情",
			get: async function(params){
				return await http.get(this.url, params);
			}
		}
	},
	tasks: {
		list: {
			url: `${config.API_URL}/admin/v1/system/tasks/list`,
			name: "系统任务管理",
			get: async function(params){
				return await http.get(this.url, params);
			}
		}
	}
}
